/*
package com.choupin.choupin.interceptor;

import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class CorsInterceptor implements HandlerInterceptor {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
     // 设置允许跨域请求的来源
        response.setHeader("Access-Control-Allow-Origin", "*");
        // 设置允许跨域请求的方法
        response.setHeader("Access-Control-Allow-Methods", "POST, GET, PUT, OPTIONS, DELETE");
        // 设置允许跨域请求的请求头
        response.setHeader("Access-Control-Allow-Headers", "x-requested-with, Content-Type");
        // 设置预检请求的有效期
        response.setHeader("Access-Control-Max-Age", "3600");
        return true;
    }
}
*/
